// 2013-7-29下午11:56:53  net.betou.trade.entity.main.base.BaseNews.java

package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Date;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.News;

/**
 * 已废弃
 * @author 叶装装
 * @deprecated
 */
public abstract class BaseNews implements Serializable{


	private static final long serialVersionUID = 8172119735885604244L;
	private Integer id;
	private String title;
	private String content;
	private Date addDate;
	
	// many to one
	private AgentAndAdmins admin;
	
	public BaseNews( ){}

	public Integer getId( ) {
		return id;
	}

	public void setId( Integer id ) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	public String getTitle( ) {
		return title;
	}

	public void setTitle( String title ) {
		this.title = title;
	}

	public String getContent( ) {
		return content;
	}

	public void setContent( String content ) {
		this.content = content;
	}

	public Date getAddDate( ) {
		return addDate;
	}

	public void setAddDate( Date addDate ) {
		this.addDate = addDate;
	}

	public AgentAndAdmins getAdmin( ) {
		return admin;
	}

	public void setAdmin( AgentAndAdmins admin ) {
		this.admin = admin;
	}
	
	private int hashCode = Integer.MIN_VALUE;
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof News ) )
			return false;
		else{
			News news = ( News ) obj;
			if( null == this.getId( ) || null == news.getId( ) )
				return false;
			else
				return( this.getId( ).equals( news.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}
	
}
